package sample;

public class PCB {
    private static final String SPACE="                                 ";
    private int name;
    private int status;//-1终止态，0就绪态
    private int priority;
    private int time;//剩余时间片
    public PCB(int name,int status,int priority,int time){
        this.setName(name);
        this.setStatus(status);
        this.setPriority(priority);
        this.setTime(time);
    }
    public String print_pcb(){
        String str= this.name +SPACE
                + this.status +SPACE
                + this.priority +SPACE
                + this.time +"\n";
        return str;
    }

    @Override
    protected PCB clone()  {
        PCB copy = new PCB(this.name, this.status, this.priority, this.time);
        return copy;
    }//深度克隆

    private enum Status{
        TEMINATED,PREPARED;
    }
    public void setName(int name) {
        this.name = name;
    }
    public int getName() {
        return name;
    }
    public void setStatus(int status) {
        this.status = status;
    }
    public int getStatus() {
        return status;
    }
    public void setPriority(int priority) {
        this.priority = priority;
    }
    public int getPriority() {
        return priority;
    }
    public void setTime(int time) {
        this.time = time;
    }
    public int getTime() {
        return time;
    }
}
